<?php echo $_REQUEST['jsoncallback']; ?>
(
<?php
	if ($code == 'success') {
		echo json_encode(array(
			'code' => 'success',
			'html' => $this->element('links', array('cur_tab' => $tab['Tab']['position'], 'links' => $links)),
			'message' => 'Ссылка успешно добавлена'
		));
	} elseif ($code == 'error') {
		echo json_encode(array(
			'code' => 'error',
			'errors' => $errors
		));
	}
?>)